package com.vehicle.mq.constant;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by yantingbin on 2017/11/30.
 */
public enum EventCommandEnum {
    SMS(1),
    MAIL(2),
    UNKNOWN(-1);
    private final byte cmd;

    EventCommandEnum(int cmd) {
        this.cmd = (byte) cmd;
    }

    public byte getCmd(){
        return this.cmd;
    }

    public static EventCommandEnum toCMD(byte b) {
        EventCommandEnum[] values = values();
        if (b>0&&b<values.length) {
            return values[b-1];
        }
        return UNKNOWN;
    }
    private static final Logger LOGGER= LoggerFactory.getLogger(EventCommandEnum.class);
}
